const express = require('express');
const videoReviewController = require('./../controllers/videoReviewController');
const authController = require('./../controllers/authController');
const router = express.Router({ mergeParams: true });

// P0ST /users/234fad4/videoReviews/:videoId
router.route('/').get(videoReviewController.getAllvideoReviews);
router.use(authController.protect);
router.route('/').post(
  videoReviewController.setvideoReviewUserId,
  // authController.restrictTo('user'),
  videoReviewController.createVideoReview
);

//search for the specific videoReview(查找指定的评论)
router
  .route('/:id')
  .get(videoReviewController.getvideoReview)
  .delete(videoReviewController.deletevideoReview);
module.exports = router;
